package com.guodefu.sensitive.handler;

import com.guodefu.sensitive.config.SensitiveStrategy;

public class IdCardSensitiveStrategy implements SensitiveStrategy {
    @Override
    public String mask(String idCard, String maskString) {
        if (idCard.length() <= 4) {
            return maskString;
        }
        return idCard.substring(0, 2) + maskString + idCard.substring(idCard.length() - 2);
    }
}
